<?php
	$config_theme = C('config_theme');
	$product_product_row = isset($config_theme['product_product_row']) ?  $config_theme['product_product_row'] : 3;
	$span = floor(12 / $product_product_row);
?>
<div class="box box-produce special">
  <div class="box-heading"><h3><span><?php echo $_['heading_title']; ?></span></h3></div>
  <div class="box-content">
    <div class="box-product">
	  <div class="row-fluid">
      <?php foreach ($products as $i => $product) { ?>
	  <?php if ($i > 0 && $i % 4 == 0) { ?>
	  </div><div class="row-fluid">
	  <?php }?>
      <div class="product-block span<?php echo $span;?>"><div class="product-inner">
        <?php if ($product['thumb']) { ?>
        <div class="image">
		<?php if($product['special'] ) {   ?>
		<div class="product-label-special label"><?php echo $_['text_sale']; ?></div>
		<?php } ?>
		<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
		</div>
        <?php } ?>
        <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
		<?php if ($product['rating']) { ?>
        <div class="rating"><img src="themes/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
        <?php } ?>
		<div class="price-cart">		
        <?php if ($product['price']) { ?>
        <div class="price">
          <?php if (!$product['special']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
          <?php } ?>
        </div>
        <?php } ?>
		<div class="cart"><input type="button" value="<?php echo $_['button_cart']; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div>
		</div>
		<div class="wishlist-compare">
		  <a class="wishlist" onclick="addToWishList('<?php echo $product['product_id']; ?>');" title="<?php echo $_['button_wishlist']; ?>" ><?php echo $_['button_wishlist']; ?></a>
		  <a class="compare"  onclick="addToCompare('<?php echo $product['product_id']; ?>');" title="<?php echo $_['button_compare']; ?>" ><?php echo $_['button_compare']; ?></a>
		</div>
      </div></div>
      <?php } ?>
	  </div>
    </div>
  </div>
</div>